#include "StdAfx.h"
#include "ChainNode.h"


ChainNode::ChainNode(void)
	:m_pTail(NULL), m_bAutoDelete(true)
{
}


ChainNode::~ChainNode(void)
{
	if(m_bAutoDelete == true)
		delete m_pTail;
	m_pTail = NULL;
}

//////////////////////////////////////////////////////////////////////////
//  [5/2/2013 Pseudonym]
void ChainNode::AddTail(ParserBase* pTail, bool bautodelete)
{
	m_pTail = pTail;
	m_bAutoDelete = bautodelete;
}


/************************************************************************/
/* ParserBase                                                           */
/************************************************************************/
ParserBase::ParserBase(const blocktype& blktype)
	:m_BlkType(blktype)
{

}
ParserBase::~ParserBase()
{

}
bool ParserBase::IsMyType(const blocktype& type)
{
	if(type == m_BlkType)
		return true;
	return false;
}

int ParserBase::SetBlockType(const blocktype& type)
{
	m_BlkType = type; 
	return RETURN_STATUS::RETURN_OK;
};
